package chapter03

/**
 * @program lu-scala01
 * @description: 匿名类
 * @author: zhanglu
 * @create: 2022-03-13 22:39:00
 */
object C10_AnnoymousClass {

  def main(args: Array[String]): Unit = {
    val person = new Person10 {
      override var name: String = "lu"

      override def eat(): Unit = println("person eat")
    }
    println(person.name)
    person.eat()
  }

}

abstract class Person10{
  var name: String
  def eat(): Unit
}
